<%
    Users user = Trader.getUser(request.getParameter("uid"));
        wstrader.task.trade.futures.Transactions task = user.trade.futures.transactions;
	
        if (!user.Authenticated()) {
                response.sendRedirect("logon.jsp");
                return;
        }
        ((Tasks)task.getOwner()).clearFocus();
        task.setFocus(true);	
        ResultSet rs;
%>

<%@include file="../header.jsp"%>

<%
        //long focused_id = task.doTask();
        //if (focused_id <= 0) focused_id = 1;
        //Record rc   = task.getRecord("purchase_contract",focused_id);
%>

<link href="style.css" rel="stylesheet" type="text/css">

<script language="javascript">
    function doFilter()
    {
        var form = document.formMain;
        form.action = "trade.futures.transactions.jsp";
        form.submit();
    }

    function clickCardView(row)
    {
        var form = document.formMain;
        if (row == null) row = old_row_obj;
        form.action = "trade.futures.transactions.card.jsp";
        form.submit();	
    }
</script>
<style type="text/css">
    <!--
    .style3 {font-family: Arial}
    .style6 {font-size: 12px}
    -->
</style>
<form action="" method="post" name="formMain" id="formMain">
    <table width="75%"  border="0" cellpadding="1" cellspacing="1">
        <tr>
            <td align="center" bgcolor="#FFFFFF"><strong></strong></td>
            <td width="150">&nbsp;</td>
            <td width="160">&nbsp;</td>
            <td width="150">&nbsp;</td>
            <td width="152">&nbsp;</td>
        </tr>
        <tr>
            <td width="150" align="center" bgcolor="#EEEEEE"><strong><span class="style29 style3 style6">Transaction Date</span></strong></td>
            <td align="center" bgcolor="#EEEEEE"><strong><span class="style29 style3 style6">Trans. Ref.No. </span></strong></td>
            <td align="center" bgcolor="#EEEEEE"><strong><span class="style29 style3 style6">Bot/Sold</span></strong></td>
            <td align="center" bgcolor="#EEEEEE"><strong><span class="style29 style3 style6">Ter.Market</span></strong></td>
            <td align="center" bgcolor="#EEEEEE"><strong><span class="style29 style3 style6">Ter.Month</span></strong></td>
        </tr>
        <tr>
            <td height="32">
                <select name="cnt_dt" size="9" id="cnt_dt" onChange="doFilter()" style="font-family:Arial; font-size:11px; width:150px;border:0">
                    <%@include file="include/FuturesContractDateList.jsp"%>
                </select>
            </td>
            <td>
                <select name="fcnt_cnt_no" size="9" id="fcnt_cnt_no" onChange="doFilter()" style="font-family:Arial; font-size:11px; width:150px;border:0">
                    <option value="0" selected>All</option>
                    <%
                            task.getResponse().setOption("futures_contract","ref_number");
                            task.getResponse().setSelected("fcnt_cnt_no");
                    %>	  
                </select>
            </td>
            <td>
                <select name="bot_sold" size="9" id="bot_sold" onChange="doFilter()" style="font-family:Arial; font-size:11px; width:160px;border:0">
                    <option value="0" selected>All</option>
                    <option value="B">BOT</option>
                    <option value="S">SOLD</option>
                    <%task.getResponse().setSelected("bot_sold");%>
                </select>
            </td>
            <td><select name="ter_mrk" size="9" id="ter_mrk" onChange="doFilter()" style="font-family:Arial; font-size:11px; width:150px;border:0">
                    <option value="0" selected>All</option>
                    <option value="NYC">NYC</option>
                    <option value="LIFFE">LIFFE</option>
                    <%task.getResponse().setSelected("ter_mrk");%>
                </select>
            </td>
            <td>
                <select name="ter_mth" size="9" id="ter_mth" onChange="doFilter()" style="font-family:Arial; font-size:11px; width:150px;border:0">
                    <%@include file="include/TerminalMonthList.jsp"%>
                </select>
            </td>
        </tr>
        <tr>
            <td height="32" colspan="5" valign="top">
                <table width="100%" height = "30"  border="1" cellpadding="0" cellspacing="0" bordercolor="#EEEEEE">
                    <tr bordercolor="#FFFBF0">
                        <td width="7%" align="center" bgcolor="#EEEEEE"><strong><span class="style29 style3 style6">Id</span></strong></td>
                        <td width="19%" align="center" bgcolor="#EEEEEE"><strong><span class="style29 style3 style6">Trn.Ref.No</span></strong></td>
                        <td width="13%" align="center" bgcolor="#EEEEEE"><strong><span class="style29 style3 style6">Trn.Date</span></strong></td>
                        <td width="9%" align="center" bgcolor="#EEEEEE"><strong><span class="style29 style3 style6">Tons</span></strong></td>
                        <td width="22%" align="center" bgcolor="#EEEEEE"><strong><span class="style29 style3 style6">Bot/Sold</span></strong></td>
                        <td width="11%" align="center" bgcolor="#EEEEEE"><strong><span class="style29 style3 style6">Ter.Mth</span></strong></td>
                        <td width="12%" align="center" bgcolor="#EEEEEE"><strong><span class="style29 style3 style6">Price</span></strong></td>
                    </tr>
                    <tr>
                        <td colspan="7">
                            <DIV id=scroll1 style="BORDER:0px ; OVERFLOW: auto; WIDTH: 100%; HEIGHT: 260px;">
                                <%@include file="trade.futures.transactions.list.details.jsp"%>
                            </DIV>
                        </td>
                    </tr>
                </table>
            </td>
        </tr>



        <tr>
            <td>
                <input type="hidden" name="uid"        id="uid"       value="<%=user.getuid()%>">
                <input type="hidden" name="task_id"    id = "task_id"   value="0">
            </td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td>&nbsp;</td>
            <td align="center"><img src="images/cardview.jpg" width="55" height="18" onClick="clickCardView()"></td>
        </tr>
    </table>
</form>
<%@include file="../footer.jsp"%>

